import { FormOptions } from "@/components/SmForm/src/types/types";
import { searchOptionsResolve } from "@/components/SmForm/src/utils";

export const useSearchForm = (handleQuery: any, queryParams: any) => {
  const searchFormOptions = ref<Array<FormOptions>>([
    {
      type: "input",
      label: "纳税人识别号",
      prop: "taxNumber",
      placeholder: "纳税人识别号",
      attrs: {
        style: { width: "100%" },
        clearable: true,
      },
    },
    {
      type: "input",
      label: "电话",
      prop: "phone",
      placeholder: "电话",
      attrs: {
        style: { width: "100%" },
        clearable: true,
      },
    },

    {
      type: "input",
      label: "开票名称",
      prop: "invoiceTitle",
      placeholder: "开票名称",
      attrs: {
        style: { width: "100%" },
        clearable: true,
      },
    },
  ]);

  searchOptionsResolve(searchFormOptions, handleQuery);

  const getSearchFormData = () => {
    return queryParams;
  };
  return {
    searchFormOptions,
    getSearchFormData,
  };
};
